// Au chargement du document, le code javascript suivant sera exécuté

$(document).ready(  

 function()
{
	var timeout = 500;
	var closetimer = 0;
	var ddmenuitem = 0;


	function MenuDeroulant_open()

	{
		//console.log("open");
	  MenuDeroulant_canceltimer();
	  MenuDeroulant_close(false);
	  ddmenuitem = $(this).find('ul').css('display', 'block');
      ddmenuitem = $(this).find('ul');
	  //ddmenuitem.slideDown('fast').show(); 
	 }


	function MenuDeroulant_close(animate)

	{  
		//console.log("close");
		if(ddmenuitem) {
			//if (animate==true)
			//	ddmenuitem.slideUp('fast')
			//	else
			ddmenuitem.css('display', 'none');
		}
	}


	function MenuDeroulant_timer()
	{
	  closetimer = window.setTimeout(function() {MenuDeroulant_close(true)}, timeout);
	}


	function MenuDeroulant_canceltimer()

	{  if(closetimer)

	   {  window.clearTimeout(closetimer);

	      closetimer = null;
	    }
	}


$(document).ready(function()
{
  $('#MenuDeroulant > li').bind('mouseover', MenuDeroulant_open)

   $('#MenuDeroulant > li').bind('mouseout',  MenuDeroulant_timer)
});

document.onclick = function() {MenuDeroulant_close (true)};


});

 
